<template>
  <div>
    <!--<div class="list-btn">
      时间:<DatePicker type="date" @on-change="startTime"  placeholder="选择开始时间" style="width: 200px" ></DatePicker>
      ～<DatePicker type="date" @on-change="endTime"  placeholder="选择结束时间" style="width: 200px"  ></DatePicker>
    </div>-->
    <!-- <div class="list-btn">
      订单状态:
      <Select clearable style="width:200px" v-model="params.status" placeholder="请选择" @on-change="get(params.status)">
        <Option v-for="item in typeList" :value="item.id" :key="item.id">{{ item.name }}</Option>
      </Select>
    </div> -->
   <!-- <div class="list-btn">
      <Button type="primary" @click="getList(url,'refresh')">搜索</Button>
    </div>-->
    <page-list :listTitle="listTitle" :list="list" :loading="loading" @selectItem="ids = $event;"></page-list>
    <page-button :current="params.pageCurrent"  :total="total" @changePageNum="params.pageCurrent = $event; getList(url)" @changePageSize="params.pageLimit = $event; getList(url)"></page-button>
  </div>
</template>

<script>
  import listMixin from '../../mixin/list'
  import pageList from '../../template/listTemplate'
  import pageButton from '../../template/pageBtnTemplate'
  import confirmDialog from '../../template/confirmDialogTemplate'
  export default {
    mixins:[listMixin],
    components: {
      pageList,
      pageButton,
      confirmDialog
    },
    methods:{
      get(s){
        console.log(s)
      }
    },
    data () {
      return {
        tag: {
          'title': '订单审核统计',
          'path': '/work/orderAudit/list'
        },
        listTitle: [
          {
            title: '日期',
            key: 'applyDate',
            minWidth: 80,
            align:'center',
            render: (h,params) =>{
              return h('div',this.getLocalDate(params.row.applyDate))
            }
          },
         {
            title: '申请数',
            key: 'applyCount',
            align:'center' ,
            minWidth: 60
          },
          {
            title: '机审数',
            key: 'machineAuditCount',
            align:'center',
            minWidth: 60
          },
          {
            title: '机审通过数',
            key: 'machineAuditPassCount',
            align:'center',
            minWidth: 60
          },
          {
            title: '机审拒绝数',
            key: 'machineAuditFailCount',
            align:'center',
            minWidth: 60
          },
          {
            title: '机审通过率',
            key: 'machineAuditPassRate',
            align:'center',
            minWidth: 60,
            render: (h,params) =>{
              return h('div',(params.row.machineAuditPassRate*100).toFixed(2)+"%")
            }

          },

          {
            title: '新户申请数',
            key: 'newUserApplyCount',
            align:'center',
            className:'color2D8CF0',
            minWidth: 60
          },
          {
            title: '新户机审数',
            key: 'newUserMachineAuditCount',
            align:'center',
            className:'color2D8CF0',
            minWidth: 60
          },
          {
            title: '新户机审通过数',
            key: 'newUserMachineAuditPassCount',
            align:'center',
            className:'color2D8CF0',
            minWidth: 60
          },
          {
            title: '新户机审拒绝数',
            key: 'newUserMachineAuditFailCount',
            align:'center',
            className:'color2D8CF0',
            minWidth: 60
          },
          {
            title: '新户机审通过率',
            key: 'newUserMachineAuditPassRate',
            align:'center',
            className:'color2D8CF0',
            minWidth: 80,
            render: (h,params) =>{
              return h('div',(params.row.newUserMachineAuditPassRate*100).toFixed(2)+"%")
            }
          },
          {
            title: '老户申请数',
            key: 'oldUserApplyCount',
            align:'center',
            className:'colorRed',
            minWidth: 60
          },
          {
            title: '老户机审数',
            key: 'oldUserMachineAuditCount',
            align:'center',
            className:'colorRed',
            minWidth: 60
          },
          {
            title: '老户机审通过数',
            key: 'oldUserMachineAuditPassCount',
            align:'center',
            className:'colorRed',
            minWidth: 60
          },
          {
            title: '老户机审拒绝数',
            key: 'oldUserMachineAuditFailCount',
            align:'center',
            className:'colorRed',
            minWidth: 60
          },
          {
            title: '老户机审通过率',
            key: 'oldUserMachineAuditPassRate',
            align:'center',
            className:'colorRed',
            minWidth: 80,
            render: (h,params) =>{
              return h('div',(params.row.oldUserMachineAuditPassRate*100).toFixed(2)+"%")
            }
          },

        ],
        url: '/statistics/order/audit',
        nameListUrl: '',
        params: {
          //status:'',
          pageCurrent: 1,
          pageLimit: 10
        },

      }
    },
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .list-btn{
    margin-bottom: 5px;
    margin-right: 5px;
    display: inline-block;
  }
  .refresh-btn{
    float: right;
  }

  /deep/ .ivu-table-cell{
    padding-left: 5px;
    padding-right: 5px;
  }
  /deep/ .color2D8CF0{
    color:#2D8CF0;
  }
  /deep/ .colorRed{
    color:mediumvioletred;
  }
</style>
